package IC.Parser;

public class LexicalError extends java.lang.Exception
{
	public static final long serialVersionUID = 1;
	
	private Integer _line, _column;
	public int GetLine() { return _line; }
	public int GetColumn() { return _column; }
	
	public LexicalError(String message)
	{
		super(message);
	}
	
	public LexicalError(String message, int line, int column)
	{
		super(message);
		_line = line;
		_column = column;
	}
	
	public LexicalError(String message, int line)
	{
		super(message);
		_line = new Integer(line);
	}
	
	public String getMessage()
	{
		if (_line == null && _column == null)
			return super.getMessage();
		
		return  ((_line == null) ? "" : "line : " + _line + ": ") + 
				((_column == null) ? "" : "column : " + _column + ": ") +
				super.getMessage() ;
	}
}
